package com.hrt.datasender.web.calSetting;

import com.btcode.web.core.annotation.RequestMapping;
import com.btcode.web.core.controller.Controller;
import com.hrt.common.web.DSRequestUnit;
import com.hrt.datasender.datadao.model.BcDevicesModel;
import com.hrt.datasender.datadao.service.BcDeviceService;
import com.hrt.db.DBManager;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
import java.util.List;


@RequestMapping(path = "CalSetting")
public class CalSettingController extends Controller {

    @RequestMapping(path = "create")
    public void create(ServletRequest arg0, ServletResponse arg1) throws IOException {
        BdCalTimeModel model = DSRequestUnit.getModel(BdCalTimeModel.class);
        model = CalSettingService.getInstance().create(model);
        success(model);
    }

    @RequestMapping(path = "getList")
    public void getList(ServletRequest arg0, ServletResponse arg1) throws IOException {
        List<BdCalTimeModel> models = CalSettingService.getInstance().getList();
        success(models);
    }
}
